package com.bargate.domain.spring.expression.value;

import org.springframework.beans.factory.annotation.Value;

/**
 * Created by IntelliJ IDEA.
 * User: EAD-MASTER
 * Date: 18/09/2010
 * Time: 23:44:29
 * To change this template use File | Settings | File Templates.
 */
public class TernaryElvisAndSafeNavigationOperations {
    @Value("#{Storm.harmful ? 'Hurricane' : 'Light Breeze'}")
    private String stormIsComing;

    @Value("#{Storm.maxWindVelocity ?: 35}")
    private Integer StormWindVelocity;

    @Value("#{Hurricane.maxWindVelocity ?: 220}")
    private Integer hurricaneWindVelocity;

    @Value("#{Hurricane?.distance}")
    private Double hurricaneDistanceFromCoast;


    @Value("#{Blizzard?.distance}")
    private Double blizzardDistanceFromCurrentLocation;

    public Double getBlizzardDistanceFromCurrentLocation() {
        return blizzardDistanceFromCurrentLocation;
    }

    public String getStormIsComing() {
        return stormIsComing;
    }

    public Integer getStormWindVelocity() {
        return StormWindVelocity;
    }

    public Integer getHurricaneWindVelocity() {
        return hurricaneWindVelocity;
    }

    public String getHurricaneDistanceFromCoast() {
        return hurricaneDistanceFromCoast == 0 ? "Storm has no distance specified" : String.valueOf(hurricaneDistanceFromCoast);
    }
}
